import React from 'react';
import Node from './Node'
const { Provider, Consumer } = React.createContext();

class Root extends React.Component {
  render() {
    return (
      // 使用 Provider 包裹你想跨组件通讯的组件
      // 传递想要跨组件通许的数据
      <Provider value={'pink'}>
        <div>
          <h1>根组件</h1>
          <hr />
          <Node />
        </div>
      </Provider>
    );
  }
}

export { Consumer }
export default Root